package com.zlzkj.app.mapper;

import com.zlzkj.app.model.PlanItem;
import com.zlzkj.core.sql.Row;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface PlanItemMapper {

    int deleteByPrimaryKey(String id);

    int deleteByPlanId(String planid);

    int insert(PlanItem record);

    int insertSelective(PlanItem record);

    PlanItem selectByPrimaryKey(String id);

    @Select("SELECT x_plan_item.* ,x_energytype.name FROM x_plan_item LEFT JOIN x_energytype ON x_energytype.id = x_plan_item.energyId WHERE x_plan_item.planId= #{planid,jdbcType=VARCHAR}")
    List<Row>  selectByPlanId(String planid);

    int updateByPrimaryKeySelective(PlanItem record);

    int updateByPrimaryKey(PlanItem record);

    int deleteByMap(Map<String, Object> map);

    int deleteByPlanIdMap(Map<String, Object> map);

    List<Row> selectByMap(Map<String, Object> map);

    int countByMap(Map<String, Object> map);

}